<div class="col_r w225">
    <?php
    $arrActivities = $activity->getAll(10);
    if (count($arrActivities) > 0) {
        ?>
        <div class="cq_activity">
            <div class="title_module">
                <h5 class="hover-act-img">Cùng quê đang làm gì</h5>
            </div>
            <div class="content_module">
                <div id="mcs_container">
                    <div class="customScrollBox">
                        <div class="container_scroll">
                            <div class="content"> 
                                <ul class="content_css1" id="ls_activity">
                                    <?php
                                    foreach ($arrActivities as $key => $value) {
                                        ?>
                                        <li >
                                            <div class="thumb"><img src="<?php echo $common->get_avatar_thumb($value['avatar']); ?>"></div>
                                            <a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $value['id']; ?>"><?php echo $value['fullname']; ?></a>: <?php echo $value['content']; ?>
                                        </li>
                                        <?php
                                    }
                                    ?>
                                </ul>

                            </div>
                        </div>
                        <div class="dragger_container">
                            <div class="dragger"></div>
                        </div>
                    </div>                       
                </div>
                <script>
                    $(document).ready(function() {
                       
                        mCustomScrollbars();
                    });

                    function mCustomScrollbars(){
                        /* 
    malihu custom scrollbar function parameters: 
    1) scroll type (values: "vertical" or "horizontal")
    2) scroll easing amount (0 for no easing) 
    3) scroll easing type 
    4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
    5) scrollbar height/width adjustment (values: "auto" or "fixed")
    6) mouse-wheel support (values: "yes" or "no")
    7) scrolling via buttons support (values: "yes" or "no")
    8) buttons scrolling speed (values: 1-20, 1 being the slowest)
                         */
                        $("#mcs_container").mCustomScrollbar("vertical",0,"easeOutCirc",1.05,"auto","yes","no",15); 
                    }

                    /* function to fix the -10000 pixel limit of jquery.animate */
                    $.fx.prototype.cur = function(){
                        if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
                            return this.elem[ this.prop ];
                        }
                        var r = parseFloat( jQuery.css( this.elem, this.prop ) );
                        return typeof r == 'undefined' ? 0 : r;
                    }

                    /* function to load new content dynamically */
                    function LoadNewContent(id,file){
                        $("#"+id+" .customScrollBox .content").load(file,function(){
                            mCustomScrollbars();
                        });
                    }
                </script>
                <script src="/js/scrollbar/jquery.mCustomScrollbar.js"></script>
            </div>
       </div>
        <?php
    }
    ?>


    <div class="suggest_friend">
        <div class="title_module">
            <h5 class="hover-act-img">Có thể bạn quen</h5>
        </div>
        <div class="content_module">
            <?php
            $arrNotFriend = $member->getNotFriend(15);
            ?>
            <ul class="displaySuggest">
                <?php
                $num_row = $db->NumRows($arrNotFriend);
                $max = $num_row >= 5 ? 5 : $num_row;
                for ($i = 0; $i < $max; $i++) {
                    $row = $db->FetchToArray($arrNotFriend);
                    ?>
                    <li >
                        <a class="thumb" href="<?php echo DOMAIN . "/thanh-vien?mid=" . $row['id']; ?>"><img src="<?php echo $common->get_avatar_thumb($row['avatar']); ?>"></a>
                        <h4><a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $row['id']; ?>"><?php echo $row['fullname']; ?></a></h4>
                        <p></p>
                        <span>
                            <span class="icon"><img src="/images/add-friend.png" alt="<?php echo $row['fullname']; ?>"></span>
                            <a rel="<?php echo $row['id']; ?>" alt="<?php echo $row['fullname']; ?>" class="btnAddFriend" href="javascript:void(0);">Kết bạn</a>
                        </span>
                        <span title="Xóa" class="removeImage" onclick=""></span>
                    </li>
                <?php } ?>

            </ul>
            <ul class="hiddenSuggest">
                <?php
                while ($row = $db->FetchToArray($arrNotFriend)) {
                    ?>
                    <li >
                        <a class="thumb" href="<?php echo DOMAIN . "/thanh-vien?mid=" . $row['id']; ?>"><img src="<?php echo $common->get_avatar_thumb($row['avatar']); ?>"></a>
                        <h4><a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $row['id']; ?>"><?php echo $row['fullname']; ?></a></h4>
                        <p></p>
                        <span>
                            <span class="icon"><img src="/images/add-friend.png" alt="<?php echo $row['fullname']; ?>"></span>
                            <a rel="<?php echo $row['id']; ?>" alt="<?php echo $row['fullname']; ?>" class="btnAddFriend" href="javascript:void(0);">Kết bạn</a>
                        </span>
                        <span title="Xóa" class="removeImage" onclick=""></span>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>

<script type="text/javascript" >
    $(".btnAddFriend").click(function(){
        showAddFriend($(this).attr("rel"));
    });
    $(".removeImage").click(function(){
        $(this).parent().remove();
        $(".displaySuggest").append($(".hiddenSuggest").find('li')[0]);
        
    });
</script>        